package whut.edu.lambda;

public class LambdaTest03 {
    public static void main(String[] args) {
        //匿名内部类
        useInter2(new Inter2() {
            @Override
            public void printMessage(String msg) {
                System.out.println("匿名内部类："+msg);
            }
        });
        //lambda表达式省略版本
        useInter2(msg->System.out.println("匿名内部类："+msg));
    }
    public static void useInter2(Inter2 inter2){
        inter2.printMessage("周新琦");
    }
}

interface Inter2{
    void printMessage(String msg);
}